package com.lafengmaker.controller;

import com.lafengmaker.vo.ResponseDTO;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * @author lafengmaker
 * @title: ExceptionHandlerAdvice
 * @projectName demo
 * @description: TODO
 * @email yeweijun@souche.com
 * @date 2/1/21 9:36 AM
 */
@ControllerAdvice
@ResponseBody
public class ExceptionHandlerAdvice {
    @ExceptionHandler(IllegalArgumentException.class)
    public ResponseDTO IllegalArgumentExe(IllegalArgumentException ie) {
        return ResponseDTO.fail(ie.getMessage());
    }
}
